var $$ = Dom7;
//初始化app
var myApp = new Framework7({
    modalTitle: 'demo',
    modalButtonOk: '知道了',
    animateNavBackIcon: false,
    tapHold:true,
    tapHoldDelay:300
});
//初始化view 
var mainView = myApp.addView('.view-main', {
	  dynamicNavbar: true
});
//开启loader
//myApp.showIndicator();
//初始化画布
var mapW = parseFloat($$("#findPath .map-container").width());
var mapH = mapW*mapImageH/mapImageW;
$$('#floor-canvas').attr('width',mapW);
$$('#floor-canvas').attr('height',mapH);
var canvas = $$('#floor-canvas')[0];
//初始化地图
$$("#findPath .map-container").css({width:mapW+'px',height:mapH+'px','background-image':'url('+mapImageFloor1+')'});
var mapRatioW = parseFloat(mapRealW/mapW);
var mapRatioH = parseFloat(mapRealH/mapH);
var mapTop,mapdy,mapLeft,mapdx,mapScale,mapdscale;
//初始化网格
$$('#findPath .map-container .net').css({width:mapW+'px',height:mapH+'px'});
var netrectW = mapW/parseFloat(netNum.x);
var netrectH = mapH/parseFloat(netNum.y);
//设备尺寸
var devW = parseFloat($$('.page-content').width());
var devH = parseFloat($$('.page-content').height());
//路径查找参数
var grid,finder;
var pathroute;
//定位点
var currentBlockX = 0;
var currentBlockY = 0;
$$('.current-icon').css({'border-radius':currenticonSize/2+'px','width':currenticonSize+'px','height':currenticonSize+'px'});
//起点终点
var startBlock,startFloor,endBlock,endFloor;
//marker
var markerPos,markerBlock,markerFloor;
$$('.loc-icon').css({width:markerSize+'px',height:markerSize+'px'});
$$('.loc-icon-start').css({width:markerSize+'px',height:markerSize+'px'});
$$('.loc-icon-end').css({width:markerSize+'px',height:markerSize+'px'});
//初始化手势
var mc = new Hammer.Manager($$('.map-container')[0], {
	recognizers: [
		// RecognizerClass, [options], [recognizeWith, ...], [requireFailure, ...]
		[Hammer.Rotate,{enable:false}],
		[Hammer.Swipe,{enable:false}],
		[Hammer.Press,{enable:false}],
		[Hammer.Tap,{enable:true}],
		[Hammer.Pan,{direction: Hammer.DIRECTION_ALL, threshold: 10}],
		[Hammer.Pinch, { enable: true }],
	]
});